package com.lczyfz.istep.modules.openstack.utils;

import com.lczyfz.istep.modules.openstack.constvary.RequestType;
import net.sf.json.JSONObject;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * ��װ��HTTP ������
 * @author jm
 */
public class Request {
	@Override
	public String toString() {
		return "Request{" +
				"host='" + host + '\'' +
				", url='" + url + '\'' +
				", header=" + header +
				", body=" + body +
				", requestType=" + requestType +
				", expectHeader=" + expectHeader +
				'}';
	}

	/** ����������� **/
	private String host;
	
	/** �������Դ��ַ **/
	private String url;
	
	/** �����ͷ�� **/
	private Map<String,String> header;
	
	/** ����ʵ�� **/
	private JSONObject body;
	
	/** �������� **/
	private RequestType requestType;

	/** ������Ӧ���践�ص�ͷ�� **/
	private List<String> expectHeader;
	
	public void setExpectHeader(List<String> expectHeader){
		this.expectHeader = expectHeader;
	}
	
	public List<String> getExpectHeader(){
		return this.expectHeader;
	}
	
	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public JSONObject getBody() {
		return body;
	}

	public void setBody(JSONObject body) {
		this.body = body;
	}

	public RequestType getRequestType() {
		return requestType;
	}

	public void setRequestType(RequestType RequestType) {
		this.requestType = RequestType;
	}
	
	public Map<String,String> getHeader(){
		return this.header;
	}
	
	public void putHeader(String key,String value){
		if(null == this.header){
			this.header = new HashMap<String,String>();
		}
		this.header.put(key, value);
	}
	

}
